package com.linkoog.devtools.view_remark.action;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.LangDataKeys;
import com.intellij.openapi.actionSystem.Presentation;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;

public abstract class AbstarctRemarkAction extends AnAction {



    @Override
    public void update(@NotNull AnActionEvent event) {
        Project project = event.getProject();
        VirtualFile virtualFile = event.getData(LangDataKeys.VIRTUAL_FILE);
        final Presentation presentation = event.getPresentation();
        if (project != null && virtualFile != null) {
            presentation.setEnabledAndVisible(virtualFile.isInLocalFileSystem());
        } else {
            presentation.setEnabledAndVisible(false);
        }
    }

}
